function qtWidget() {
    var ticker = "";
    var html = "";
    var elId = "";
    var $container = null;
    var $iframe = null;
    var $mask = null;
    var $tab = null;
	var $researchTab = null;
    var $insiderTab = null;
    var selectedTabValue = "q";
	var selectResearchTabValue = "a";
    var objId = "";
    var companyId = "";
    var selectInsiderTabValue = "i";
    var pageUrls = {q:"qt.htm?",c:"chart.htm?",n:"qnews.htm?",
                           f:"http://globaldocuments.morningstar.com/documentlibrary/CompanyDoc.aspx?Block=Financials&searchtype=1&doccategory=equity&keyword=&clientid=dotcom",
                           p:"performance.htm?",
                           a:"analyst.htm?",
                           fc:"financial.htm?",
                           v:"valuation.htm?",
                           i:"insiderOwner.htm?",
                           pe:"comesoon.htm?"}
    var pageUrls2 = {
        Profile:'profile.htm',
        Analysis:'analysis.htm',
        Fundamental:'fundamental.htm',
        Owners:'owners.htm',
        Insiders:'insiders.htm',
        Filings:'filings.htm',
        Bonds:'bonds.htm',
        Options:'options.htm'
    }
    var insiderPageUrls = {i:"insiderOwner.htm?", i2:"insiderAct.htm?",i3:"insiderKE.htm?",i4:"insiderBD.htm?"}    
	var anaylstResearchUrls = {a:"analyst.htm?",a2:"analystArc.htm?",a3:"analystTopStocks.htm?"};                
    var tabMenu = null, tabList = [{
        txt: "Profile",
        id: 0,
        closable: false
    }, {
        txt: "Analysis",
        id: 1,
        closable: false
    }, {
        txt: "Fundamental",
        id: 2,
        closable: false
    }, {
        txt: "Owners",
        id: 3,
        closable: false
    }, {
        txt: "Insiders",
        id: 4,
        closable: false
    }, {
        txt: "Filings",
        id: 5,
        closable: false
    }, {
        txt: "Bonds",
        id: 6,
        closable: false
    }, {
        txt: "Options",
        id: 7,
        closable: false
    }];
    
    this.id = "";

    this.init = function(config, id, containerId, objStr) {
        this.id = id;
        if (config && config.Ticker != null) {
            ticker = config.Ticker; 
        }
        if (config && config.ticker != null) {
            ticker = config.ticker; 
        }
        objId = objStr;
        elId = containerId;
        html =  '<div  id="div_' + elId + '" style="background:#fefefe">'+
                '<div class="rtq-qt-tab-out">'+
                '<div class="rtq-qt-tabs"><div class="rtq-qt-tabs-inner">'+
                '<div class="rtq-qt-tabs-base"></div> </div>  </div> </div><div class="rtq-qt-insider-tab" style = "display:none" idkey="insiderTab"><span><a class="on" tkey="i">Executive Compensation</a><a href="javascript:void(0)" tkey="i2">Insider Activity</a><a href="javascript:void(0)" tkey="i3">Key Executives</a><a href="javascript:void(0)"tkey="i4">Board of Directors</a></span></div><div idkey="research" style="display: none;" class="rtq-qt-research-tab"><span><a tkey="a" class="on">Analyst Research</a><a tkey="a2" href="javascript:void(0)">Analyst Report Archive</a><a tkey="a3" href="javascript:void(0)">Top Rated Stocks in Sector</a></span></div><iframe id="ifm_' + elId + '" name = "div_' + elId + '" style="overflow:auto; border:0px"></div></iframe><div id="mask_' + elId + '"  style= "display:none;position:absolute;left:0px;top:0px">&nbsp;</div>';
        $('#'+containerId).html(html); 
        if (ticker != null && ticker != "") {
            if (!checkIFrame())
                return;
            this.initComponent(ticker);
        }
    };

    this.getHtml = function() {
        return html;
    };

    this.changeOutSize = function(w, h) {
        if (!checkIFrame())
            return;
        $container.css({ width: w + "px", height: h + "px" });
        $mask.css({ width: w + "px", height: h + "px" });
        if (w < 955)
            w = 955;
        $iframe.css({ width: w + "px", height: h + "px" });
    };
	this.initComponent= function(){
		selectedTabValue = "q";
        $tab.find("a.rtq-qt-tabs-colon").removeClass("rtq-qt-tabs-colon").addClass("rtq-qt-tabs-col");
        $tab.find("[tkey='q']").removeClass("rtq-qt-tabs-col").addClass("rtq-qt-tabs-colon");
        if (this.setTitle){
            var t = ticker.split(":");
            this.setTitle("Quicktake:",t[t.length-1]);
        }
        var u;
        if (!checkIFrame())
            return;
        if (selectedTabValue != "")
            u = pageUrls[selectedTabValue]+ "t=" + ticker+"&p=div_"+elId;;
        $iframe.attr("src", u);
	};
    this.acceptTicker = function(symbol) {
        if (symbol==null||symbol=="") {
            return;
        }
		var k = gData[symbol]?symbol:gIdMap[symbol];
        var info = gData[k];
		if (info) {
			ticker = info.exch+":"+info.ticker;
			this.initComponent();
		}
    };
    tabMenu = new Util.TabMenu($('.rtq-qt-tabs-inner')[0], [], {
        onActive: function(tab){
            (pageUrls2[tab.txt]);
        },
        beforeClose: function(tab){
            
        }
    }, {
        width: 100,
        isExcuteCallbackAtInit:false,
        autoResize: false,
        tabsList:true
    });
    tabMenu.reBindData(tabList);

    this.saveConfig = function() {
        return {Ticker: ticker};
    };

    this.toggleMask = function(show) {
        if (show)
            $mask.css("display", "BLOCK");
        else
            $mask.css("display", "NONE");
    };
    function checkIFrame()
    {
        if (!$iframe) {
            $container = $("#div_" + elId);
            $iframe = $("#ifm_" + elId);
            $mask = $("#mask_" + elId);
            $tab = $container.find(".rtq-qt-tabs-low");
            $insiderTab = $container.find(".rtq-qt-insider-tab");
			$researchTab = $container.find(".rtq-qt-research-tab");
            $tab.find("a").unbind("click");
            $tab.find("a").bind("click",function(e){
                                                     var flag = $(this).attr("class") == "rtq-qt-tabs-col" ? true: false;
                                                     $tab.find("a.rtq-qt-tabs-colon").removeClass("rtq-qt-tabs-colon").addClass("rtq-qt-tabs-col");
                                                     $(this).removeClass("rtq-qt-tabs-col").addClass("rtq-qt-tabs-colon");
                                                     var v = $(this).attr("tkey");
                                                     if (flag || selectedTabValue  != v) {
                                                         selectedTabValue = v;
                                                         loadPage(); 
                                                     }
                                                });
            $insiderTab.find("a").unbind("click");
            $insiderTab.find("a").unbind("click").bind("click",function(e){
                                                     var v = $(this).attr("tkey");
                                                     $insiderTab.find("a.on").removeClass("on");
                                                     $insiderTab.find("a[tkey='"+v+"']").addClass("on");
                                                     if (selectInsiderTabValue  != v) {
                                                         selectInsiderTabValue = v;
                                                         loadInsiderPage(); 
                                                     }
                                                });   
			$researchTab.find("a").unbind("click").bind("click",function(e){
                                                     var v = $(this).attr("tkey");
                                                     $researchTab.find("a.on").removeClass("on");
                                                     $researchTab.find("a[tkey='"+v+"']").addClass("on");
                                                     if (selectResearchTabValue  != v) {
                                                         selectResearchTabValue = v;
                                                         loadResearchPage(); 
                                                     }
                                                });                                       
        }
        if($iframe)
            return true;
        return false;
    }
    
    function loadPage() {
        if (ticker != ""){
            var url = pageUrls[selectedTabValue]+"t="+ticker+"&p=div_"+elId;
        }
        if (selectedTabValue == "f") {
            $insiderTab.hide();
			$researchTab.hide();
            if (companyId == "") {
                if (typeof(checkTickerInfo) != "undefined") {
                    checkTickerInfo(ticker,objId+".getCompanyId");
                }
            } else {
                $iframe.attr("src", pageUrls[selectedTabValue]+"&companyId="+companyId);
            }           
        } else if (selectedTabValue == "i") {
            selectInsiderTabValue = "i";
            $insiderTab.find("a.on").removeClass("on");
            $insiderTab.find("a[tkey='i']").addClass("on");
            $insiderTab.show();
			$researchTab.hide();
            $iframe.attr("src", url);
        } else if (selectedTabValue == "a") {
			selectInsiderTabValue = "a";
			$researchTab.find("a.on").removeClass("on");
			$researchTab.find("a[tkey='a']").addClass("on");
			$researchTab.show();
			$insiderTab.hide();
			$iframe.attr("src", url);
		} else {
			$insiderTab.hide();
			$researchTab.hide();
			$iframe.attr("src", url);
		}
    }
    
    function loadInsiderPage() {
  		var div = "&p=div_"+elId;         
        $iframe.attr("src", insiderPageUrls[selectInsiderTabValue]+"t="+ticker+div);       
    }
    function loadResearchPage() {
		var div = "&p=div_"+elId;         
        $iframe.attr("src", anaylstResearchUrls[selectResearchTabValue]+"t="+ticker+div);       
	}
    this.getCompanyId = function(obj) {
        if (!obj.Records)
        return;
        var r = obj.Records[0];
        companyId = r.CFID;
        $iframe.attr("src", pageUrls[selectedTabValue]+"&companyId="+companyId);
    }
}